from common.basic2 import send_message_to_kafka2, upate_meassage_id, save_file, upate_meassage_time

data = {
    "message": {
        "project": "scan_api",
        "packetType": "http",
        "data": {
            "id": "4BBZ3FE977D042Z2970AD75D70Z33E04",
            "httpType": 1,
            "host": "www.HTTRACE.com",
            "port": 18500,
            "httpDirection": 2,
            "uri": "/out",
            "fullUri": "http://www.HTTRACE.com/put",
            "requestIp": "11.11.11.13",
            "requestMethod": "GET",
            "requestTime": "2023-08-15 23:48:16",
            "requestTimestamp": 1692114496000,
            "requestTimestampStr": None,
            "requestContentLength": 110,
            "requestContentType": "application/json",
            "requestHeader": "{\"Referer\":\"http://10.10.2.236:31269\",\"Origin\":\"10.10.2.233:31101\",\"User-Agent\":\"HTTrack\",\"Accept\":\"text/plain, application/json, application/*+json, */*\",\"Connection\":\"Keep-Alive\",\"Host\":\"10.10.2.240:32381\",\"Accept-Encoding\":\"gzip,deflate\",\"Content-Length\":\"110\",\"Content-Type\":\"application/json\"}",
            "requestBody": "{\"password\":\"123456\",\"@type\":\"200\",\"a\":\"1\",\"LOL\":\"Lee Sin\",\"age\":\"18\",\"hero\":\"bigman\"}",
            "sensitiveChars": None,
            "statusCode": 200,
            "costTime": 18,
            "responseIp": "1.1.1.1",
            "responseTime": "2023-08-15 23:48:16",
            "responseTimestamp": 1692114496123,
            "responseTimestampStr": None,
            "responseContentLength": 0,
            "responseContentType": "application/json",
            "responseHeader": "{\"Set-Cookie\":\"name=123123;SameSite=Lax\",\"content-dispositoin\":\"attachment\",\"access-control-allow-origin\":\"www.httpbin.org\",\"Transfer-Encoding\":\"chunked\",\"Keep-Alive\":\"timeout=60\",\"Connection\":\"keep-alive\",\"Vary\":\"Access-Control-Request-Headers\",\"Date\":\"Mon, 10 Oct 2022 13:54:38 GMT\",\"Content-Type\":\"application/json\",\"Server\":\"nginx/1.2.9\",\"Access-Control-Allow-Origin\":\"*\"}",
            "responseBody": "{\"name\":\"elasticsearch<script >\",\"password\":\"123456\",\"cluster_uuid\":\"2c248XANRVClgOVPd91OiA\",\"version\":{\"number\":\"7.11.5\",\"build_flavor\":\"default\",\"build_type\":\"docker\",\"build_hash\":\"8d61b4f7ddf931f219e3745f295ed2bbc50c8e84\",\"build_date\":\"2022-06-23T21:57:28.736740635Z\",\"build_snapshot\":false,\"lucene_version\":\"8.11.1\",\"minimum_wire_compatibility_version\":\"6.8.0\",\"minimum_index_compatibility_version\":\"6.0.0-beta1\"},\"tagline\":\"You Know, for Search\"}",
            "complete": True,
            "hasIllegalAsset": False,
            "url": "http://confluence.bhaf.com.cn/plugins/servlet/confluence/placeholder/macro",
            "referer": "http://10.10.2.236:31200",
            "userAgent": "ly-Apache-HttpClient/4.5.13 (Java/1.8.0_151)"
        }
    },
    "callBack": None,
    "messageType": "http"
}

# 发送报文到kafka
send_message_to_kafka2('10.10.2.236:30519', 'process_message_event', data,1,1)